<?php
class Logging{
	// define default log file
	private $log_file = 'log.txt';

	// set log file (path and name)
	public function lfile($path) {
		$this->log_file = $path;
	}
	// write message to the log file
	public function lwrite($message) {

		$mdate = date('d/m/Y', time());

		//$script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);
		// define current time
		$time = date('H:i:s');

		// Append to the file
		$current = $mdate." ".$time." ".$message."\n";
		file_put_contents($this->log_file, $current, FILE_APPEND | LOCK_EX);
	}
}